<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增供应商发货跟踪')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-track-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">项目号：</label>
                <div class="col-sm-8">
                    <input name="projectNo" th:value="${projectNo}" class="form-control" type="text" required readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">项目负责人：</label>
                <div class="col-sm-8">
                    <input name="projectManager" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">供应商ID：</label>
                <div class="col-sm-8">
                    <input name="supplierId" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">供应商：</label>
                <div class="col-sm-8">
                    <input name="supplier" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">产品号：</label>
                <div class="col-sm-8">
                    <input name="productCode" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">产品型号：</label>
                <div class="col-sm-8">
                    <input name="productModel" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">数量：</label>
                <div class="col-sm-8">
                    <input name="productNum" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">币种：</label>
                <div class="col-sm-8">
                    <input name="currency" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">发货地：</label>
                <div class="col-sm-8">
                    <input name="placeShipment" class="form-control" type="text">
                </div>
            </div>

            <div class="form-group">    
                <label class="col-sm-3 control-label">预计到货时间：</label>
                <div class="col-sm-8">
                    <input name="expectedArrivalDate" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">实际到货时间：</label>
                <div class="col-sm-8">
                    <input name="actualArrivalDate" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">供应商验货照片：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="shippingDocPhoto">
                    <div class="file-loading">
                        <input class="form-control file-upload" id="shippingDocPhoto" name="file" type="file">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">供应商提供箱单：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="supplierPackingList">
                    <div class="file-loading">
                        <input class="form-control file-upload" id="supplierPackingList" name="file" type="file">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">供应商发货信息：</label>
                <div class="col-sm-8">
                    <input name="supplierLogistics" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">跟单验货照片：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="supplierPhotoUrl">
                    <div class="file-loading">
                        <input class="form-control file-upload" id="supplierPhotoUrl" name="file" type="file">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">跟单验货箱单：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="supplierPackingListUrl">
                    <div class="file-loading">
                        <input class="form-control file-upload" id="supplierPackingListUrl" name="file" type="file">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">仓库编码：</label>
                <div class="col-sm-8">
                    <input name="warehouseCode" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">发货仓库：</label>
                <div class="col-sm-8">
                    <input name="warehouse" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">发货数量：</label>
                <div class="col-sm-8">
                    <input name="shippedQuantity" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">实际箱号：</label>
                <div class="col-sm-8">
                    <input name="actualContainerNo" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remarks" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: bootstrap-fileinput-js"/>
    <script th:inline="javascript">
        var prefix = ctx + "ds/track"
        $("#form-track-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-track-add').serialize());
            }
        }

        $("input[name='createdAt']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='updatedAt']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $(".file-upload").fileinput({
            uploadUrl: ctx + 'common/upload',
            maxFileCount: 10,
            autoReplace: true
        }).on('fileuploaded', function (event, data, previewId, index) {
            $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
        }).on('fileremoved', function (event, id, index) {
            $("input[name='" + event.currentTarget.id + "']").val('')
        })
    </script>
</body>
</html>